﻿using FairyGUI;

/// <summary>
/// 消息
/// </summary>
public class UIHome_Message : UIPopupWindow {

	public UIHome_Message()
    {
        // 加载界面
        base.Init(UIPackage.CreateObject("主界面", "消息界面").asCom);

        // 初始化关闭按钮
        GButton closeBtn = uiComp.GetChild("关闭按钮").asButton;
        closeBtn.onClick.Add(() => {
			DebugInfo.Log("关闭 消息界面");

            AudioController.inst.PlayUIClickEffect();
            uiComp.RemoveFromParent();
            uiComp.Dispose();
            base.Close();
        });
    }

    /// <summary>
    /// 弹出窗口
    /// </summary>
    public static void Popup()
    {
		DebugInfo.Log("打开 消息界面");
		UIRootController.inst.PopupWindow(new UIHome_Message());
    }
}
